<template>

	<view class="article">
		<!-- #ifdef APP-PLUS -->
		<uni-nav-bar :statusBar="true" :border="false"></uni-nav-bar>
		<!-- #endif -->
		<view class="article-title">{{ infoData.chepaihao }}</view>
		
		<uni-list :border="false">
			<uni-list-item title="车牌号" :rightText="infoData.chepaihao"/>
			<uni-list-item title="车型" :rightText="infoData.chexing"/>
			<uni-list-item title="姓名" :rightText="infoData.xingming"/>
			<uni-list-item title="出单人" :rightText="infoData.chudanren"/>
			<uni-list-item title="创建日期" :rightText="infoData.createTime"/>
			<uni-list-item title="类型" :rightText="infoData.leixing"/>
			<uni-list-item title="保费" :rightText="infoData.baofei+''"/>
			<uni-list-item title="保额" :rightText="infoData.baoe+''"/>
			<uni-list-item title="保单号" :rightText="infoData.baodanhao"/>
			<uni-list-item title="保险公司" :rightText="infoData.baoxiangongsi"/>
			<uni-list-item title="备注" :note="infoData.beizhu"/>
			<uni-list-item title="提醒次数" :rightText="infoData.cishu"/>
			<uni-list-item title="待结算" :rightText="infoData.daijiesuan"/>
			<uni-list-item title="代理返" :rightText="infoData.dailifan"/>
			<uni-list-item title="日期" :rightText="infoData.riqi"/>
			<uni-list-item title="道路" :rightText="infoData.daolu"/>
			<uni-list-item title="剩余到期天数" :rightText="infoData.daoqitianshu"/>
			<uni-list-item title="手机号" :rightText="infoData.shoujihao"/>
			<uni-list-item title="卖车" :rightText="infoData.maiche"/>
			<uni-list-item title="更新日期" :rightText="infoData.updateTime"/>
			<uni-list-item title="脱保日期" :rightText="infoData.tuobaoriqi"/>
			<uni-list-item title="约提日期" :rightText="infoData.ytriqi"/>
			<uni-list-item title="备注" :note="infoData.beizhu"/>
		</uni-list>
				
	</view>
</template>

<script>
	// #ifdef APP
	import uniNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue';
	// #endif
	export default {
		// #ifdef APP
		components:{
			"uni-nav-bar":uniNavBar
		},
		// #endif
		data() {
			return {
				// 当前显示 _id
				id: "",
				title: 'title',
				infoData:{}, // 详情
			}
		},
		
		onLoad(event) {
			//获取真实新闻id，通常 id 来自上一个页面
			if (event.id) {
				this.id = event.id
			}
			//若上一页传递了标题过来，则设置导航栏标题
			if (event.title) {
				this.title = event.title
				uni.setNavigationBarTitle({
					title: event.title
				})
			}
		},
		onReady() {
			// 开始加载数据，需要等组件渲染完毕后才开始执行 loadData，所以不能再 onLoad 中执行
			if (this.id) { // ID 不为空，则发起查询
				this.loadData()
			} else {
				uni.showToast({
					icon: 'none',
					title: this.$t('listDetail.newsErr')
				})
			}
		},
		
		methods: {
			
			loadData(data) {
				this.$api.bxtzInfo({id:this.id}).then(res=>{
					console.log("res",res)
					this.infoData = res
					
					this.title = res.chepaihao
					uni.setNavigationBarTitle({
						title: res.chepaihao
					})
				})
			},
			
			
		}
	}
</script>

<style scoped>
	.article-title {
		padding: 20px 15px;
		padding-bottom: 0;
	}
	
	.article-content {
		padding: 15px;
		font-size: 15px;
		overflow: hidden;
	}
	
	.list-bottom{
		margin-bottom: 15px;
	}
</style>
